﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GtaAPIClient
{
    public partial class TestForm : Form
    {
        public TestForm()
        {
            InitializeComponent();
        }


        private void button2_Click(object sender, EventArgs e)
        {
            string str = textBox1.Text; 
            if (!str.Contains(",")) return;

            string[] strArr = str.Split(',');
            if (strArr == null || strArr.Length < 9) return;

            string capitalAccount = strArr[0];
            string stockCode = strArr[1];
            int buySell = int.Parse(strArr[2]);
            int openClose = int.Parse(strArr[3]); 
            float orderQuty = float.Parse(strArr[4]);
            float orderPrice = float.Parse(strArr[5]); 
            int marketPrice = int.Parse(strArr[6]); 
            string traderId = strArr[7];
            string traderPassword = strArr[8];  
            IfManage im = new IfManage();
            //string ss = im.doIfOrderTest(capitalAccount, stockCode, buySell, openClose, orderQuty, orderPrice, marketPrice, traderId, traderPassword);
            //textBox3.AppendText(ss);
            //textBox3.AppendText("\n");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            //直接测试代码 
            if (radioButton1.Checked)
            {
                XhManage xm = new XhManage();
                xm.test();
            }
            if (radioButton2.Checked)
            {
                IfManage im = new IfManage();
                im.test();
            }
            if (radioButton3.Checked)
            {
                RzrjManage rz = new RzrjManage();
                rz.test();
            } 
        }

    }
}
